package com.jps;


import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.messaging.Sink;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.stream.annotation.StreamListener;
import org.springframework.messaging.handler.annotation.Payload;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;

/**
 * create by lenovo 2020/9/29
 */

@EnableBinding(Sink.class)
@Slf4j
@Component
public class StreamReceiver {

    @StreamListener(value = Sink.INPUT)
    public void receive(Object msg){
        System.out.println(" toptic topticjps receive message="+msg+",receive time="+ LocalDateTime.now());
    }
}
